<template>
  <div id="app">
  <vue-core-video-player 
  src="https://51smt-1256923431.cos.ap-nanjing.myqcloud.com/upload/43add7ebadb3e427992c65deb73c6f0b/43add7ebadb3e427992c65deb73c6f0b.mp4"
  ref="videoPlayer"
  :playsinline="true"
  :options="playerOptions"
  @pause="onPlayerPause($event)"
  @play="onPlayerPlay($event)"
  @ended="onPlayerEnded($event)"
  ></vue-core-video-player>
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
        playerOptions: {
          // videojs options
          muted: true,
          language: 'zh_CN',
          playbackRates: [0.7, 1.0, 1.5, 2.0],
          sources: [{
            src: "https://51smt-1256923431.cos.ap-nanjing.myqcloud.com/upload/43add7ebadb3e427992c65deb73c6f0b/43add7ebadb3e427992c65deb73c6f0b.mp4"
          }],
          poster: "/static/images/author.jpg",
        },
    }
  },
  methods:{
    // 停止
    onPlayerPause:function(player) {
      console.log(player);
    }, 
    // 播放
    onPlayerPlay:function(player) {
      console.log(player);
    },
    // 完成
    onPlayerEnded() {},
  },
   computed: {
    player() {
      return this.$refs.videoPlayer.player;
    },
  },
}
</script>

<style>

</style>
